<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box border-hover-style">
      <div
        class="Showroom-parent"
        :class="!props.info.remarks && !props.info.subTitle && !props.info.value && 'Showroom-center'"
        v-if="props.info.digitalShowroom"
      >
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img
        class="outline-parent-bg"
        v-if="props.info.value"
        :src="publicUrls + 'free/style13/Level2outlineStyle2Bg.webp'"
        alt=""
      />
      <img
        class="outline-parent-bg"
        v-else
        :src="publicUrls + 'free/style13/Level2outlineStyle2Bg2.webp'"
        alt=""
      />
      <div class="outline">
        <div
          class="cover"
          v-if="props.info.value"
          @click="ImgVisible = true"
          @mouseenter="flag = true"
          @mouseleave="flag = false"
          style="z-index: 1"
        ></div>
        <div
          class="outline-content"
          :class="!props.info.remarks && !props.info.subTitle && !props.info.value && 'outline-center'"
        >
          <div class="content-title">
            <div class="outline-text1" v-if="props.info.text.length >= 5">
              {{ props.info.text.slice(0, -4) }}
            </div>
            <div class="outline-text">
              <p>{{ props.info.text.slice(-4) }}</p>
            </div>
          </div>
          <div class="content-box-left" v-if="props.info.subTitle || props.info.remarks">
            <div class="outline-subTitle" v-if="props.info.subTitle">
              {{ props.info.subTitle }}
            </div>
            <TextMax
              v-if="props.domShow"
              :infoData="props.info"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle ? 3 : 5"
            ></TextMax>
          </div>
        </div>
      </div>
      <div class="cover" :class="flag && 'outline-content-hover'" v-if="props.info.value">
        <img class="outline-cover" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style8/firstLevelOutline2Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free13Style2',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style13.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();
const flag = ref(false);
const ImgVisible = ref(false);

const props = defineProps<{
  info: {
    text: string;
    remarks?: string;
    subTitle?: string;
    value?: string;
  };
  domShow: boolean;
}>();

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 280px;
}
.shadow {
  width: 560px;
  height: 188px;
  position: absolute;
  bottom: -30px;
  left: 70px;
}
.flex-box {
  width: 504px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 19;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 20;
}
.outline-start {
  padding-top: 157px !important;
  .outline-text {
    margin-bottom: 148px;
  }
}
.outline-center {
  align-items: center;
  justify-content: center !important;
}
.outline-content {
  width: 360px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px 0 80px 0;
}
.content-title {
  width: 308px;
}
.outline-text1 {
  text-align: center;
  font-family: SourceHanSerifCN-Bold;
  font-size: 24px;
  color: #333333;
  line-height: 48px;
}
.outline-text {
  ::v-deep p {
    font-family: Slidexiaxing;
    font-size: 64px;
    color: #333333;
    line-height: 77px;
  }
}

.content-box {
  display: flex;
  justify-content: center;
  align-items: start;
  width: 34px;
  height: auto;
  position: relative;
  background: #345746;
  box-shadow: inset 0px 6px 0px 0px #232c28, inset 0px -6px 0px 0px #232c28;
  border: 2px solid #dab475;
  padding-top: 138px;
  padding-bottom: 14px;
  span {
    width: 100%;
    display: block;
    font-family: SourceHanSerifCN-Bold;
    text-align: start;
    writing-mode: vertical-rl;
    letter-spacing: 4px;
    font-size: 24px;
    line-height: 32px;
    color: #f1d88e;
    text-shadow: 0px 3px 2px rgba(0, 0, 0, 0.5), 0px -1px 1px rgba(0, 0, 0, 0.15);
  }
}
.content-box-left {
  width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: end;
}

.outline-subTitle {
  width: 270px;
  color: #000000;
  text-align: center;
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  line-height: 28px;
  margin-bottom: 12px;
  opacity: 0.8;
}
.outline-content-hover {
  img {
    transform: scale(1.5);
  }
}
.cover {
  width: 100%;
  height: 331px;
  overflow: hidden;
  position: absolute;
  top: 190px;
  left: 0;
  z-index: -2;
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
  }
}
.Showroom-center {
  top: 50px !important;
}
.Showroom-parent {
  position: absolute;
  top: 180px;
  right: 60px;
  z-index: 21;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.6) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ff0505 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>